#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTcpSocket>
#include <QHostAddress>
#include "databasemanager.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr,const QString &host_username=nullptr,const QString &host_last_time=nullptr);
    ~Widget();
    void closeEvent(QCloseEvent *);
    void set_basement(const QString& username,const QString &nickname);
signals:
    void closeWidget();
private slots:
    void on_sendBtn_clicked();
    void SendLinkSuccessMsg();
    void ReceiveMsg();

private:
    Ui::Widget *ui;
    QString host_username;
    QString username;
    QString nickname;
    QTcpSocket* socket;
    QString host_last_time;
};
#endif // WIDGET_H
